package com.ukao.cashregister.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.mcxtzhang.commonadapter.rv.CommonAdapter;
import com.mcxtzhang.commonadapter.rv.ViewHolder;
import com.ukao.cashregister.R;
import com.ukao.cashregister.bean.ProductRelImgBean;
import com.ukao.cashregister.utils.ImageUtils;

import java.util.List;

/**
 * Created by ukaodev on 2017/6/14.
 */

public class BottomPhotoAdapter extends CommonAdapter<ProductRelImgBean> {



    public BottomPhotoAdapter(Context context, List<ProductRelImgBean> datas ) {
        super(context, datas, R.layout.adapter_bottom_photo);
    }



    @Override
    public void convert(final  ViewHolder holder, ProductRelImgBean item) {
        ImageView imagePhoto=holder.getView(R.id.image_photo);
        LinearLayout layout=holder.getView(R.id.layout);


        ImageUtils.loadImages(mContext,item.getCameraImg(),imagePhoto);
        if (item.isCheck()){
           layout.setBackgroundColor(mContext.getResources().getColor(R.color.green));
        }else{
            layout.setBackgroundColor(mContext.getResources().getColor(R.color.Black22));
        }

    }


}
